package com.wordsay.entity;

import java.math.BigDecimal;

public class HotItem {

	private String name;
	private long frequency;
	private BigDecimal hotRate;
	
	
	public HotItem(String name,long frequency){
		
		this.name = name;
		this.frequency = frequency;
		hotRate = new BigDecimal(0);
	}
	
	
	public BigDecimal getHotRate() {
		return hotRate;
	}

 
	public void setHotRate(BigDecimal hotRate) {
		this.hotRate = hotRate;
	}

	public HotItem(String name){
		
		this.name = name;
		this.frequency = 0;
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public long getFrequency() {
		return frequency;
	}
	public void setFrequency(long frequency) {
		this.frequency = frequency;
	}
	
	public void frequencyAdd(){
		
		this.frequency++;
	}
	
	
	public void increaseFrequency(long frequency){
		
		this.frequency = this.frequency  + frequency;
	}

	public boolean equals(Object obj){
		
		if(!(obj instanceof HotItem)){
			
			return false;
		}
		
		HotItem temp = (HotItem)obj;
		
		if(temp.getName().trim().equals(this.getName().trim())){
			
			return true;
		}
		
		return false;
	}
	
}
